package main;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;

public class Fifo {

	public static Queue<Page> fifo = new LinkedList<Page>();
	public static int QUEUE_SIZE = 7;
	
	public static void add(Page page){
	
		if(fifo.size() <= QUEUE_SIZE){
			fifo.add(page);
		}else{
			remove();
			add(page);
		}
		
	} 
	
	public static Queue<Page> getArray(){
		
		return fifo;
	}
	
	public static void remove(){
		
		if(fifo.isEmpty()){
		
			System.out.println("queue is already empty");
			
		} else {
			
			fifo.remove();
		}
		
	}
	
	
	
}
